<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<%@ include file="/commons/commonEdit.jsp"%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<script language="JavaScript" src="${ctx}/scripts/common/prototype.js"></script>
<script type="text/javascript" src="${ctx}/scripts/common.js"></script>
<script type="text/javascript">
	var ACTION_URL="${ctx}/charge_businessCodeAction.do?";
	function init(){
		$('pageList').src = ACTION_URL + "method=list";
	}
	//新建交易码
	function openNew(){
		var url=ACTION_URL + "method=initAdd";
		top.windowOpen(url, 'editPage', '${key.add}', 270, 400, true, "editPageIframe");
	}

	//修改交易码
	function openEdit(){
		if( getSelectedRecordID() != "" ){
			var url=ACTION_URL + "method=initEdit&keyword="+getSelectedRecordID();
			top.windowOpen(url, 'editPage', '${key.edit}', 270, 400,true, "editPageIframe");
		}else{
			ErrorAlert('${key.tipsByModify}');
		}
	}

	//弹出删除提示窗口
	function showDelete(){
		if( getSelectedRecordID() == "" ){
			ErrorAlert('${key.tipsByDelete}');
		}else{
			AlarmConfirm('${key.tipsByDeleteConfirm}',"main","deleteRecord");
		}
	}
	//执行删除
	function deleteRecord(){
		var url=ACTION_URL + "method=delete&keyword="+getSelectedRecordID();
		var myAjax = new Ajax.Request(
	                   url,
	                   {method: 'post', parameters:"" , onComplete: showResponseDelete}
	                   );
	}
	//删除响应
	function showResponseDelete(transport){
		ajaxSubmitException(transport.responseText);
		if(transport.responseText=="false"){
			FailureAlert('${key.doFalse}');
		}else{
			reLoadIFrameListWithQuery();
		}
	}

	//获取当前选择的记录
	function getSelectedRecordID(){
		return window.frames("pageList").selectedRecordID;
	}

	//重新加载列表页面,不保留条件的刷新
	function reLoadIFrameList(){
		var url= ACTION_URL + "method=list"+"&ec_s_SYSDATE=DESC";
		$('pageList').src=url;
	}

	//重新加载列表页面,保留查询条件的刷新
	function reLoadIFrameListWithQuery(){
		window.frames("pageList").freshFrame();
	}



</script>
</head>
<body onload="init();">
<div style="overflow:auto; height:500px;">
<div class="pageNav_bg">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td id="pageNav_leftimg"><img src="${ctx}/images/ico_fc_jiaoyima.gif"
			width="46" height="47" /></td>
		<td id="navWord"><span class="page_title">${key.bizcodemanage}</span></td>
		<td class="pageNav_right"><a href="javascript:showFull_in();"><img
			id="full_image" src="${ctx}/images/ico_fullscreen.gif" border="0" /></a></td>
	</tr>
</table>
</div>
<div class="container">
<table border="0" cellspacing="0" cellpadding="0" width="100%"
	class="bg_search" id="search01">
	<tr>
		<td>&nbsp;</td>
	</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">

	<tr>
		<td class="bg_toolBar">
		<table border="0" cellpadding="0" cellspacing="0">
			<tr>
             <pms:AuthTag authName="charge_businessCodeAction.do?method=initAdd">
				<td class="toolbarico"><a href="#"
					onclick="openNew();"
					onfocus="this.blur()"><img src="${ctx}/images/ico_newfile.gif"
					border="0" align="absbottom" alt="${key.add}" />&nbsp;</a></td>
			</pms:AuthTag>
			<pms:AuthTag authName="charge_businessCodeAction.do?method=initEdit">
				<td class="toolbarico"
					><a href="#"
					onFocus="this.blur()"
					onClick="openEdit();"><img
					src="${ctx}/images/ico_amend.gif" alt="${key.edit}" width="16"
					height="16" border="0" align="absbottom" /></a></td>
			</pms:AuthTag>
			<pms:AuthTag authName="charge_businessCodeAction.do?method=delete">
				<td class="toolbarico"><a href="#"
					onClick="showDelete();"
					onFocus="this.blur()"><img src="${ctx}/images/ico_delete.gif"
					alt="${key.delete}" width="16" height="16" border="0" align="absbottom"></a></td>
			</pms:AuthTag>
			</tr>
		</table>
		</td>
	</tr>
	<tr>
		<td valign="top">
		<iframe id="pageList" height="400PX"
							name="pageList" frameborder="0" border="0"
							src=""
							width="100%"></iframe>
		</td>
	</tr>
</table>
</div>
</div>
</body>
</html>
